<%@ page language="java" contentType="text/html; charset=windows-1255"
	pageEncoding="windows-1255"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.io.File"%>
<%@page import="java.io.FileFilter"%>
<html>
<head>
<meta http-equiv="Content-Type"
	content="text/html; charset=windows-1255">
<title>Portfolio List</title>
<style type="text/css">
.style1 {
	text-align: center;
}
</style>
</head>
<link rel="stylesheet" type="text/css" href="css/styles.css?v=57"
	media="all" />
<body>

<div id="ajax-poster-photo">
<div id="ajax-poster-photo-logo-nav-container"
	style="left: -52px; top: 0px; width: 803px"><img
	src="images/microsoft_office_logo.jpg" alt="Microsoft"
	style="width:75px;height:75px;" />
<h1 style="color: white">Your Portfolio</h1>
</div>
</div>

<table cellpadding="0" cellspacing="0" border="0" id="layouttable">

	<td style="width: 200pt">
	<div id="content">
	<div id="content-top">
	<div>
	<div><!-- top corners and border --></div>
	</div>
	</div>
	<div id="content-middle">
	<div id="content-middle2">
	<div id="topright-decoration"></div>

	<table>
		<!-- MSTableType="layout" -->
		<thead>
			<tr
				style="height: 29px; border-style: solid; border-color: #648ABD; background-color: #7395C1">
				<td style="width: 81px; height: 29px" class="style1"><strong>Porfolio
				Name</strong></td>
			</tr>
		</thead>
		<tr>
			<%
				String path = config.getServletContext().getRealPath("/db");

				if (path == null) {
					java.net.URL url = config.getServletContext().getResource("/db");
					path = url.getPath();
				}

				File root = new File(path);

				File[] files = root.listFiles(new FileFilter() {
					public boolean accept(File f) {
						if (f.getName().endsWith("xlsx")) {
					if (!f.getName().equalsIgnoreCase("empty.xlsx")) {
						return true;
					}
						}
						return false;
					}
				});

				if (files != null) {
					for (File f : files) {
			%>
		
		<tr>
			<td><a href="list.jsp?fileName=<%= f.getName() %>"><%=f.getName()%></a>
			</td>
		</tr>
		<%
			}
			}
		%>



	</table>
	<br />

	</div>
	</div>
	</div>
	</td>

	<td valign="top">
	<table>
		<td width="100%">
		<div id="content">
		<div id="content-top">
		<div>
		<div><!-- top corners and border --></div>
		</div>
		</div>
		<div id="content-middle">
		<div id="content-middle2">
		<table>
			<tr>
				<td>Or, upload a new portfolio</td>
			</tr>
			<tr>
				<td>

				<form action="upload" METHOD="POST" ENCTYPE="multipart/form-data">
				<table>
					<tr>
						<td>Enter file name: <input type="file" name="file1" /></td>
					</tr>
					<tr>
						<td><input type="submit" /></td>
					</tr>
				</table>
				</form>
				</td>
			</tr>
		</table>
		<br />
		<img alt="" src="images/spacer.gif" width="100px" height="1px" />
		<div id="topright-decoration"></div>
		</div>
		</div>
		</div>
		</td>
	</table>
	</td>

</table>
</body>
</html>
